$(function(){
	 if(sessionStorage['username']){
	Newtouch.Ajax.sendParams({userName:sessionStorage['username']},localStorage['APP_AJAX_PATH']+"/drinkingBar/view/main.jsp.findUserByName",function(data){
		androidLocal({"userId":data.id});
	});
	}
	Newtouch.Ajax.sendParams("",localStorage['APP_AJAX_PATH']+"/drinkingBar/view/main.jsp.findProductCatagory",function(data){
		for(i=0;i<data.length;i++){
			$("#productCatagory").append('	<li><a title="'+data[i].name+'"  onclick=goTo('+data[i].id+') target="_top">'
					+'	<img src="'+data[i].image+'"></a>'
					+'<a title="'+data[i].name+'" target="_top">'+data[i].name+'</a>'
					+'	</li>'
			
					);
			
		}
	},function(err){
		alert("读取失败！");
	});
});
function goTo(id){
	androidLocal({"catagoryId":id});

	if(id == 6){
		window.location="topTenProduct.html";
	}else{
		window.location="productCatagory.html";
	}
}
var androidLocal=function(p){
	for(var k in p){
		sessionStorage[k]=p[k];
	}
	
}